/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package filetrans;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.List;
import model.Torrent;
import View.Login;
import xmlwriter.TorrentWriter;

/**
 *
 * @author Oscar
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Login start = new Login();

        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = start.getSize();

        if (frameSize.height > screenSize.height) {
            frameSize.height = screenSize.height;
        }

        if (frameSize.width > screenSize.width) {
            frameSize.width = screenSize.width;
        }

        start.setLocation((screenSize.width - frameSize.width) / 2,
                (screenSize.height - frameSize.height) / 2);
        start.setVisible(true);


        //writing xml file

//        TorrentWriter writer = new TorrentWriter();
//
//        writer.setFile("torrents.xml");
//
//        List<Torrent> userList = new ArrayList<Torrent>();
//        userList.add(new Torrent("oscar.xml","1234","5"));
//        userList.add(new Torrent("carlos.iso","4321","2"));
//        userList.add(new Torrent("karem.txt","8975","1"));
//
//        try{
//            writer.saveConfig(userList);
//        }
//        catch(Exception e) {
//
//        }
    }

}






